package com.edu.exam.enums.quality;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 难度级别枚举
 */
@Getter
@AllArgsConstructor
public enum DifficultyLevel {
    VERY_EASY("VERY_EASY", "非常简单"),
    EASY("EASY", "简单"),
    NORMAL("NORMAL", "普通"),
    MEDIUM("MEDIUM", "中等"),
    HARD("HARD", "困难"),
    VERY_HARD("VERY_HARD", "非常困难"),
    EXTREME("EXTREME", "极端困难");

    private final String code;
    private final String description;

    public static DifficultyLevel fromCode(String code) {
        for (DifficultyLevel level : values()) {
            if (level.getCode().equals(code)) {
                return level;
            }
        }
        return NORMAL; // 默认返回普通
    }
}